<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty {custom_bgcolor} function plugin
 *
 * Type:     function<br>
 * Name:     custom_bgcolor <br>
 *           the passed parameters
 *      (Smarty online manual)
 * @author Bhatu Pawar <bhatupawar85 at gmail dot com>
 * @param array
 * @param Smarty
 * @return string

 */
function smarty_function_custom_metatag($params, &$smarty)
{
    //require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
	
	require_once DOC_ROOT."/dealaday/model/cms.php";

	$listCmsObj  = new Model_CMS();
	
	if($_GET['cmsid'])
	{
		if($_SESSION['user_Site_Id'])
		{
			// Get metatag description title, description and keyword
			$meta = $listCmsObj->getCMSPage(base64_decode($_GET['cmsid']), $_SESSION['user_Site_Id']);
		
			return	$metatag = '<meta name="title"  content="'.$meta['meta_title'].'"><meta name="description" content="'.$meta['meta_tag'].'" ><meta name="keywords"  content="'.$meta['meta_keyword'].'">';
			
		}

	}
}

/* vim: set expandtab: */

?>
